﻿using Entity;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace IDal
{
    /// <summary>
    /// 用户数据访问接口
    /// </summary>
    public interface IUserInfoDal:IBaseDal<UserInfo>
    {
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        public bool CreateUserInfo(UserInfo userInfo);

        /// <summary>
        /// 获取所有用户(没有真正查出来的)
        /// </summary>
        public DbSet<UserInfo> GetUserInfos();

        /// <summary>
        /// 获取所有用户(没有真正查出来的)
        /// </summary>
        public List<UserInfo> GetUserInfos<T>(Expression<Func<UserInfo, bool>> keySelector);

        /// <summary>
        /// 获取所有用户
        /// </summary>
        public List<UserInfo> GetUserInfos(Expression<Func<UserInfo, bool>> keySelector);

        /// <summary>
        /// 获取所有用户(没有真正查出来的)
        /// </summary>
        public DbSet<UserInfo> GetUserInfosDbSet();

        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool UpdateUserInfo(UserInfo entity);
    }
}